﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OCompleteMacNGReportPage.aspx.cs" Inherits="IHISCETeim.Web.MachineSys.MacModel.OCompleteMacNGReportPage" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>完成机器问题分析统计报表</title>
    <link rel="stylesheet" type="text/css" href="../ext4/resources/css/ext-all.css" />
    <script type="text/javascript" src="../ext4/bootstrap.js"></script>
    <script type="text/javascript">
        //数据获取
        Ext.require(['Ext.data.*']);
        Ext.require('Ext.chart.*');
        Ext.require(['Ext.Window', 'Ext.fx.target.Sprite', 'Ext.layout.container.Fit']);
        Ext.onReady(function () {
            window.store1 = Ext.create('Ext.data.JsonStore', {
                fields: ['月份', '百分比'],               
                data:<%=BindReport1Dat() %>
            });
            window.store2 = Ext.create('Ext.data.JsonStore', {
                fields: ['月份', '百分比'],               
                data:<%=BindReport2Dat() %>
            });
            window.store3 = Ext.create('Ext.data.JsonStore', {
                fields: <%=GetReport3FiledData() %>,               
                data:<%=GetReport3Data() %>
            });
            window.store4 = Ext.create('Ext.data.JsonStore', {
                fields: <%=GetReport3LineDataFiled(false) %>,               
                data:<%=GetReport3LineDat("性能检测不良率") %>
            });
            window.store5 = Ext.create('Ext.data.JsonStore', {
                fields: <%=GetReport3LineDataFiled(false) %>,               
                data:<%=GetReport3LineDat("出入库不良率") %>
            });

            window.store7 = Ext.create('Ext.data.JsonStore', {
                fields: ['Station','ngcount'],               
                data:<%=GetReport4Dat() %>
            });
            window.store8 = Ext.create('Ext.data.JsonStore', {
                fields: ['Exceptionrecord','NGCount','fpy'],               
                data:<%=GetReport5Dat() %>
            });
            window.store9 = Ext.create('Ext.data.JsonStore', {
                fields: ['Supplier','NGCount','ALLNGCount','topngitm'],               
                data:<%=GetReport6Dat() %>
            });
        })
        //

Ext.onReady(function () {    
    var win = Ext.create('Ext.panel.Panel', { 
        maximizable: true,
        title: '一.生产一次合格率',
        width:1200,
        closable: true,
        collapsed: false,
        collapsible: true,
        layout: {columns: 1, type: 'table'},
        renderTo: Ext.getBody(),
        items: [
                {
                    xtype: 'label',
                    text: '1.一次性能检测合格台数：<%=OInspection_GetReport1(Year, Month)["NotNGCount"]%>台,性能检测台数：<%=OInspection_GetReport1(Year,Month)["AllCount"]%>台.一次性能检测合格率：<%=Convert.ToDecimal(OInspection_GetReport1(Year,Month)["FPY"]).ToString("F1")%>%（一次性能检测合格数/性能检测台数X100%）.'
                },
                {
                    xtype: 'chart',
                    style: 'background:#fff',
                    animate: true,
                    store: store1,
                    height: 200,
                    width: 550,
                    shadow: true,
                    title:"性能测试一次合格率",
                    theme: 'Category2',
                    axes: [{
                        type: 'Numeric',
                        minimum: 0,
                        position: 'left',
                        fields: ['百分比'],
                        title: '百分比',
                        minorTickSteps: 1,
                        grid: {
                            odd: {
                                opacity: 1,
                                fill: '#ddd',
                                stroke: '#bbb',
                                'stroke-width': 0.1
                            }
                        }
                    }, {
                        type: 'Category',
                        position: 'bottom',
                        fields: ['月份'],
                        title: '性能测试一次合格率'
                    }],
                    series: [{
                            type: 'line',
                            highlight: {
                                size: 7,
                                radius: 7
                            },
                            axis: 'left',
                            xField: '月份',
                            yField: '百分比',
                            markerConfig: {
                                type: 'cross',
                                size: 4,
                                radius: 4,
                                'stroke-width': 0
                            },
                            label: {
                                field: '百分比',
                                display: 'insideEnd',
                              'text-anchor': 'middle',
                                renderer: Ext.util.Format.numberRenderer('0.0%'),
                                orientation: 'vertical',
                                color: '#333'
                            },
                            tips: {
                              trackMouse: true,
                              width: 140,
                              height: 28,
                              renderer: function(storeItem, item) {
                                this.setTitle(storeItem.get('月份') + ': ' + storeItem.get('百分比') + ' %');
                              }
                            }
                        }]
                  },
                  {
                        xtype: 'label',
                        text: '2.一次出入库检查合格台数：<%=OInspection_GetReport2(Year, Month)["NotNGCount"]%>台,出入库台数：<%=OInspection_GetReport2(Year,Month)["AllCount"]%>台.一次出入库合格率：<%=Convert.ToDecimal(OInspection_GetReport2(Year,Month)["FPY"]).ToString("F1")%>%（一次出入库合格数/出入库台数X100%）.'
                   },
                  {
                    xtype: 'chart',
                    style: 'background:#fff',
                    animate: true,
                    store: store2,
                    height: 200,
                    width: 550,
                    shadow: true,
                    theme: 'Category3',
                    axes: [{
                        type: 'Numeric',
                        minimum: 0,
                        position: 'left',
                        fields: ['百分比'],
                        title: '百分比',
                        minorTickSteps: 1,
                        grid: {
                            odd: {
                                opacity: 1,
                                fill: '#ddd',
                                stroke: '#bbb',
                                'stroke-width': 0.5
                            }
                        }
                    }, {
                        type: 'Category',
                        position: 'bottom',
                        fields: ['月份'],
                        title: '出入库检查一次合格率'
                    }],
                    series: [{
                            type: 'line',
                            highlight: {
                                size: 7,
                                radius: 7
                            },
                            axis: 'left',
                            xField: '月份',
                            yField: '百分比',
                            markerConfig: {
                                type: 'cross',
                                size: 4,
                                radius: 4,
                                'stroke-width': 0
                            },
                            label: {
                                field: '百分比',
                                display: 'insideEnd',
                              'text-anchor': 'middle',
                                renderer: Ext.util.Format.numberRenderer('0.0%'),
                                orientation: 'vertical',
                                color: '#333'
                            },
                            tips: {
                              trackMouse: true,
                              width: 140,
                              height: 28,
                              renderer: function(storeItem, item) {
                                this.setTitle(storeItem.get('月份') + ': ' + storeItem.get('百分比') + ' %');
                              }
                            }
                        }]
                  }
                ]
       
    });

     var win2 = Ext.create('Ext.panel.Panel', {
      
        maximizable: true,
        title: '二.各机型不良率',
         width:1200,
        closable: true,
        collapsed: false,
        collapsible: true,
        renderTo: Ext.getBody(),
        items: [{
                xtype: 'gridpanel',
                store: store3,
                columnLines: true,
                columns: <%=GetReport3ColumnJs() %>,  
                viewConfig: {
                    stripeRows: true
                }
            }
            ,
            {
                    xtype: 'panel',
                 
                    layout: {
                        type: 'column'
                    },
                    items: [
                        {
                            xtype: 'chart',
                            height: 200,
                            width:550,
                            animate: true,
                            store: store4,
                             theme: 'Category4',
                            insetPadding: 20,
                            axes: [
                                {
                                    type: 'Category',
                                    fields: [
                                        '月份'
                                    ],
                                    position: 'bottom',
                                    title: '性能测试品异对比分析表'
                                },
                                {
                                    type: 'Numeric',
                                    fields: <%=GetReport3LineDataFiled(true) %>,
                                    position: 'left',
                                    title: '不良率'
                                }
                            ],
                            series: <%=GetReport3LineSeries() %>,
                            legend: {
                                position: 'right'
                            }
                        },
                        {
                            xtype: 'chart',
                            height: 200,
                            width: 550,
                            animate: true,
                            store: store5,
                             theme: 'Category5',
                            insetPadding: 20,
                            axes: [
                                {
                                    type: 'Category',
                                    fields: [
                                        '月份'
                                    ],
                                    position: 'bottom',
                                    title: '出入库品异对比分析表'
                                },
                                {
                                    type: 'Numeric',
                                    fields: <%=GetReport3LineDataFiled(true) %>,
                                    position: 'left',
                                    title: '不良率'
                                }
                            ],
                            series: <%=GetReport3LineSeries() %>,
                            legend: {
                                position: 'right'
                            }                            
                        }
                    ]
                }
            ]        
    });

    //3
    var win3 = Ext.create('Ext.panel.Panel', {
        width:1200,      
        height:250,     
        maximizable: true,
        title: '三.生产品质信息表',
        closable: true,
        collapsed: false,
        collapsible: true,
        renderTo: Ext.getBody(),
        layout: 'fit',
        items: [
                {
                     id: 'chartCmp',
                        xtype: 'chart',
                        style: 'background:#fff',
                        animate: true,
                        shadow: true,
                        height:250,
                        store: store7,
                       theme: 'Category6',
                        axes: [{
                            type: 'Numeric',
                            position: 'left',
                            fields: ['ngcount'],
                            label: {
                                renderer: Ext.util.Format.numberRenderer('0,0')
                            },
                            title: '问题发现次数',
                            grid: true,
                            minimum: 0
                        }, {
                            type: 'Category',
                            position: 'bottom',
                            fields: ['Station'],
                            title: '生产品质信息统计表(月份)'
                        }],
                        series: [{
                            type: 'column',
                            axis: 'left',
                            highlight: true,
                            tips: {
                              trackMouse: true,
                              width: 140,
                              height: 28,
                              renderer: function(storeItem, item) {
                                this.setTitle(storeItem.get('Station') + ': ' + storeItem.get('ngcount') );
                              }
                            },
                            label: {
                              display: 'insideEnd',
                              'text-anchor': 'middle',
                                field: 'ngcount',
                                renderer: Ext.util.Format.numberRenderer('0'),
                                color: '#333'
                            },
                            xField: 'Station',
                            yField: 'ngcount'
                        }]
                }
              ] 
    });
//4
         var win4 = Ext.create('Ext.panel.Panel', {
                maximizable: true,
                title: '四.重点问题汇总',
                closable: true,
                 width:1200,
                collapsed: false,
                collapsible: true,
                renderTo: Ext.getBody(),
                layout: {
                    type: 'column'
                },
                 items: [
                    {
                        xtype: 'gridpanel',
                        store: store8,
                        columns: [
                            {
                                xtype: 'gridcolumn',
                                dataIndex: 'Exceptionrecord',
                                width:150,
                                text: '项目'
                            },
                            {
                                xtype: 'gridcolumn',
                                dataIndex: 'fpy',
                                width:130,
                                text: '频率（不良次数/不良总次数）'
                            }
                        ],
                        viewConfig: {

                        }
                    },
                    {
                        xtype: 'chart',
                        width: 500,
                        height:450,
                        animate: true,
                        insetPadding: 20,
                        store: store8,
                        series: [
                            {
                                type: 'pie',
                                field: 'NGCount',
                                showInLegend: true,
                                donut:25,
                                tips: {
                                  trackMouse: true,
                                  width: 140,
                                  height: 28,
                                  renderer: function(storeItem, item) {
                                        //calculate percentage.
                                        var total = 0;
                                        store8.each(function(rec) {
                                            total += rec.get('NGCount');
                                        });
                                        this.setTitle(storeItem.get('Exceptionrecord') + ': ' + Math.round(storeItem.get('NGCount') / total * 100) + '%');
                                    }
                                },
                                highlight: {
                                  segment: {
                                    margin: 20
                                  }
                                },
                                label: {
                                    field: ['Exceptionrecord'],
                                    display: 'rotate',
                                    contrast: true,
                                    font: '11px Arial'
                                }
                            }
                        ]
                    }
                ]
         });
        //5
        var win5 = Ext.create('Ext.panel.Panel', {
            maximizable: true,
            title: '五.外协件（性能测试与出入库检查）品异汇总',
            closable: true,
             width:1200,
            collapsed: false,
            collapsible: true,
            renderTo: Ext.getBody(),
            layout: {
                type: 'column'
            },
                items: [
                {
                    xtype: 'gridpanel',
                    store: store9,
                    columns: [
                        {
                            xtype: 'gridcolumn',
                            dataIndex: 'Supplier',
                            width:80,
                            text: '供应商'
                        },
                        {
                            xtype: 'gridcolumn',
                            dataIndex: 'topngitm',
                            width:120,
                            text: '主要问题'
                        },
                        {
                            xtype: 'numbercolumn',
                            dataIndex: 'NGCount',
                            width:80,
                            text: '次数'
                        }
                    ],
                    viewConfig: {

                    }
                },
                {
                    xtype: 'chart',
                    width: 1000,
                    height:250,
                    animate: true,
                    insetPadding: 20,
                    store: store9,
                    axes: [{
                        type: 'Numeric',
                        position: 'left',
                        fields: ['NGCount'],
                        label: {
                            renderer: Ext.util.Format.numberRenderer('0')
                        },
                        title: '问题发生次数',
                        grid: true,
                        minimum: 0
                    }, {
                        type: 'Category',
                        position: 'bottom',
                        fields: ['Supplier'],
                        title: '外协件（性能测试与出入库检查）品异统计表'
                    }],
                    series: [
                        {
                            type: 'column',
                            axis: 'left',
                            highlight: true,
                            tips: {
                              trackMouse: true,
                              width: 140,
                              height: 28,
                              renderer: function(storeItem, item) {
                                this.setTitle(storeItem.get('Supplier') + ': ' + storeItem.get('NGCount') + '次');
                              }
                            },
                            label: {
                              display: 'insideEnd',
                              'text-anchor': 'middle',
                                field: 'NGCount',
                                renderer: Ext.util.Format.numberRenderer('0'),
                                color: '#333'
                            },

                            xField: 'Supplier',
                            yField: 'NGCount'
                        }
                    ]
                }
            ]
        });
});

 
    </script>
</head>
<body>
   
</body>
</html>
